package cn.edu.cqvie.jdk8.fun;

@FunctionalInterface
interface MyInterface {

    void test();

    String toString();
}


public class Test2 {

    private void myTest( MyInterface myInterface) {
        System.out.println(1);
        myInterface.test();
        System.out.println(2);
    }


    public static void main(String[] args) {
        Test2 test2 = new Test2();
        test2.myTest(() -> {
            System.out.println("mytest");
        });
        System.out.println("----------------");

        MyInterface myInterface = () -> {
            System.out.println("mytest");
        };
        System.out.println(myInterface.getClass());

        System.out.println(myInterface.getClass().getSuperclass());
        System.out.println(myInterface.getClass().getInterfaces().length);
        System.out.println(myInterface.getClass().getInterfaces()[0]);

    }
}
